<!-- 投诉详情 -->
<template>
	<view class="detail">
		<view class=""> 相关任务信息</view>
		<view class="">
			<view> <text>任务名称</text><text>{{obj.taskName}}</text> </view>
			<view><text>任务时间 </text><text>{{`${obj.taskStartTime} 至 ${obj.taskEndTime}` }}</text>
			</view>
			<view><text>雇员昵称</text><text>{{obj.employeeName}}</text> </view>
		</view>
		<view class="">
			<view class="">
				<view class=""> {{obj.plate}}-{{obj.type}} </view>
				<view class="" v-if="obj.status!==2"> 预计结案时长 {{obj.closingTime}}小时 </view>
				<view class="">{{obj.complaintContent}}</view>
			</view>
		</view>
		<view class="">
			<view class="">
				<view><text>发起时间 </text><text>{{obj.createTime}}</text> </view>
				<view><text>投诉状态</text><text
						:class="[(obj.status==1&&'active') ]">{{ (obj.status==0&&'未受理')||(obj.status==1&&'受理中')||(obj.status==2&&'已结案')}}
					</text> </view>
			</view>
		</view>
		<view><text>客服留言</text><text>{{obj.remarkTxt}}</text> </view>
	</view>
</template>
<script>
	export default ({
		data() {
			return {
				id: '',
				obj: {}
			}
		},
		onLoad(value) {
			this.id = value.id
			this.getDetail()
		},
		mounted() {},
		methods: {
			async getDetail() {
				let res = await this.$fetch(this.$api.get_complaint_list_detail, {
					id: this.id,
				}, 'GET')
				if (res.code) return
				let data = res.data
				for (let key in data) {
					if (['taskStartTime', 'taskEndTime', 'createTime'].includes(key)) {
						try {
							data[key] = data[key].substring(5, 16)
						} catch (e) {
							//TODO handle the exception
						}
					}
				}
				this.obj = res.data
			},
		},
	})
</script>
<style lang="scss" scoped>
	.detail {
		margin: 50rpx 28rpx 0;

		&>view:nth-child(1) {
			font-size: 32rpx;
			font-weight: bold;
			color: #262626;
			margin-bottom: 20rpx;
		}

		&>view:nth-child(2) {
			height: 200rpx;
			background: #FFFFFF;
			border-radius: 12rpx;
			opacity: 1;
			display: flex;
			flex-direction: column;
			justify-content: space-between;

			&>view {
				display: flex;
				justify-content: space-between;
				margin: 0 48rpx 0 20rpx;

				&>text:first-child {
					font-size: 28rpx;
					font-weight: bold;
					color: #515151;
				}

				&>view:last-child {
					font-size: 28rpx;
					font-weight: 400;
					color: #515151;
				}
			}

			&>view:first-child {
				margin-top: 20rpx;
			}

			&>view:last-child {
				margin-bottom: 24rpx;
			}
		}

		&>view:nth-child(3) {
			background: #FFF;
			border-radius: 12rpx;
			opacity: 1;
			margin-top: 20rpx;
			padding: 30rpx 0;

			&>view {
				margin: 0 20rpx;

				&>view:first-child {
					font-size: 36rpx;
					font-weight: bold;
					color: #262626;
				}

				&>view:nth-child(2) {
					font-size: 24rpx;
					font-weight: bold;
					color: #7F7F7F;
					margin: 20rpx 0;
				}

				&>view:nth-child(3) {
					font-size: 28rpx;
					font-weight: 400;
					color: #515151;
					word-wrap: break-word;
				}
			}
		}

		&>view:nth-child(4) {
			overflow: hidden;
			background: #FFF;
			border-radius: 12rpx;
			width: 100%;
			height: 160rpx;
			margin-top: 20rpx;

			&>view {
				margin: 0 20rpx;
				display: flex;
				flex-direction: column;
				justify-content: space-between;

				&>view {
					display: flex;
					justify-content: space-between;

					&>text:nth-child(1) {
						font-size: 28rpx;
					}
				}

				&>view:nth-child(1) {
					margin-top: 30rpx;

					&>text:nth-child(1) {
						font-size: 28rpx;
						color: #262626;
						font-weight: bold;
					}

					&>text:nth-child(2) {
						font-size: 24rpx;
						color: #515151;
						font-weight: bold;
						opacity: 0.8;
					}
				}

				&>view:nth-child(2) {
					margin-top: 20rpx;

					&>text:nth-child(1) {
						font-size: 28rpx;
						font-weight: bold;
						color: #515151;
					}

					&>text:nth-child(2) {
						font-size: 28rpx;
						color: #7F7F7F;
					}

					.active {
						color: rgba(255, 133, 29, 1) !important;
					}
				}
			}
		}

		&>view:nth-child(5) {
			overflow: hidden;
			background: #FFF;
			border-radius: 12rpx;
			width: 100%;
			height: 100rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-top: 20rpx;

			&>text:nth-child(1) {
				font-size: 28rpx;
				color: #262626;
				font-weight: bold;
				margin-left: 20rpx;
			}

			&>text:nth-child(2) {
				font-size: 24rpx;
				color: #515151;
				font-weight: bold;
				margin-right: 20rpx;
			}
		}
	}
</style>